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

Query time 0.00043