UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QuBnlpVTUSeBC3ZAk8jBZUiyHmnsNC0UKRhiWRQPw0Q=' 
WHERE 
  key_id = '129b653bc1e7ef3747e0c68caeaa16ae63e34969ceaf3e291ec270a3887cf730' 
  AND (
    token = 'QuBnlpVTUSeBC3ZAk8jBZUiyHmnsNC0UKRhiWRQPw0Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031