UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yi17tQP5fJ6rpim/0upP+qv6Yx4yP/m0FCz1YVbClko=' 
WHERE 
  key_id = '51154d10bb2a1e8317f8b201e5d0cce515a75303801e0b934317a5b1a0f11b77' 
  AND (
    token = 'yi17tQP5fJ6rpim/0upP+qv6Yx4yP/m0FCz1YVbClko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036