UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wgN7ZNyP/nkXRYtAoaxIhYxeurpGeHKJGTnyt856RRE=' 
WHERE 
  key_id = '4d4ef947e9ac0d0281d140faa0d079bd8e3c000c5225dc3f6028f4343d7a604d' 
  AND (
    token = 'wgN7ZNyP/nkXRYtAoaxIhYxeurpGeHKJGTnyt856RRE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024