UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jAbuf0MQjveAVlz9D8hSid2KVln1Nn7zXlJm8mwlNEE=' 
WHERE 
  key_id = '14b3e786d0c1d4878656b79c39d7a6955d7d538205d95f910e044145bf51c55f' 
  AND (
    token = 'jAbuf0MQjveAVlz9D8hSid2KVln1Nn7zXlJm8mwlNEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035