UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mdQzadMBwXgFnY+2yTvGhSGELVSuX5KWyWpIpd/x/S4=' 
WHERE 
  key_id = '272cfe3f13e7e419f4130cfd6a683860ff77a666c1e189f561783783529bf037' 
  AND (
    token = 'mdQzadMBwXgFnY+2yTvGhSGELVSuX5KWyWpIpd/x/S4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00110