UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+F3lI/ovXs/CHTgi2z1OX8EnfIPESnkS8HeD9itcHHQ=' 
WHERE 
  key_id = '2db15dd0c6a3ed3baaf9d9a91af67345b60bea2321dc490f9b95d981ddf7c7b5' 
  AND (
    token = '+F3lI/ovXs/CHTgi2z1OX8EnfIPESnkS8HeD9itcHHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00095