UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NFY6l76+jHDi4dd/ygH23LkZ7nVWIRlP+2PouGN5WYE=' 
WHERE 
  key_id = '8e40061f08ed86f44b6849c7fa4a9f9165c9c8d1ee7c407c96d1bbd5fdbb9b8f' 
  AND (
    token = 'NFY6l76+jHDi4dd/ygH23LkZ7nVWIRlP+2PouGN5WYE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037