UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mf11GYnOvQZQy02QIAkv2WM6UDDi/JT97aG4NYwDxQM=' 
WHERE 
  key_id = '16564d377125b28aace15990441b76f0b926c964ddc7f07409b50fa533ca2db6' 
  AND (
    token = 'mf11GYnOvQZQy02QIAkv2WM6UDDi/JT97aG4NYwDxQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042