UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5CzLC8YzONHmZQuoxFZqaZJz+1EJjCF9J7KVeHmG9ww=' 
WHERE 
  key_id = 'f2670be6674d73ebf8ce5b54423ebc1caf0d7b78e1035c98f6ad3b653e15a8c8' 
  AND (
    token = '5CzLC8YzONHmZQuoxFZqaZJz+1EJjCF9J7KVeHmG9ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024