UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xT+/3e34R1gmyOKoeh4zrZVenfpSfUZJQiwCplW2Nsw=' 
WHERE 
  key_id = '8d04e7126892c30fda77bad2f4f75c5cd0b543ecfdde5520566cc58d446d974c' 
  AND (
    token = 'xT+/3e34R1gmyOKoeh4zrZVenfpSfUZJQiwCplW2Nsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031