UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D+r/Fkxs4PwfdTISmZJf4W68NS0ZZFlRx/ZQMj63swY=' 
WHERE 
  key_id = 'c2ffddd2aa98bad3a300c9d4ad383056e2b613777bbba8546ef631bffb05cc9b' 
  AND (
    token = 'D+r/Fkxs4PwfdTISmZJf4W68NS0ZZFlRx/ZQMj63swY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017