UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlNtEt0QBjd90kmj75593cyRqEZ+XLIptlBrlIXY6IQ=' 
WHERE 
  key_id = '994d2c9bb0fd5f3a222aa651a6797612beed16e6f00f9e424263cff4e7e8017c' 
  AND (
    token = 'rlNtEt0QBjd90kmj75593cyRqEZ+XLIptlBrlIXY6IQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037