UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ORsw6fxplXIdFhiUCZNmz4dpXF15OEWQEyTzNeKRVak=' 
WHERE 
  key_id = '418b9ec37148e96b756d2c0d5cdb9f4d32902b34b5e709ca96fde94f858c6cc5' 
  AND (
    token = 'ORsw6fxplXIdFhiUCZNmz4dpXF15OEWQEyTzNeKRVak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027