UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z+48Q51+kPKAp34BN9RRO/8lEY60EyMVm7gsf2S5b5k=' 
WHERE 
  key_id = '3a02d8cd2bd27be63c57bb40df25c75f291ffcebd73dd3830a78f5ba2c1cf837' 
  AND (
    token = 'Z+48Q51+kPKAp34BN9RRO/8lEY60EyMVm7gsf2S5b5k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039