UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z6ITUS0VT824KByrlJ86+KKttCl5FGr9HX4TSPWrp5g=' 
WHERE 
  key_id = 'b3a2581558f61601d09e8706c7d5c40fdc3c94aba433fd7da211185913bf4691' 
  AND (
    token = 'Z6ITUS0VT824KByrlJ86+KKttCl5FGr9HX4TSPWrp5g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019