UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GgfiL6NyrCxm3Lvi3KljrVuA2bQFH0ydFq4BY9WDFZE=' 
WHERE 
  key_id = '973066b439be2a2ca3c8afa1fb8d9a3c9e49e62e7beba7efeca7890b508afe1c' 
  AND (
    token = 'GgfiL6NyrCxm3Lvi3KljrVuA2bQFH0ydFq4BY9WDFZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034