UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yCP7wHW3XvaonnOqDUv6PKFrFLy6lFCU5ASDd/SwRzE=' 
WHERE 
  key_id = 'ae023ef13146424d96e870ff51264e427bb236693b8fa74fdb7b8acbcee5e2f8' 
  AND (
    token = 'yCP7wHW3XvaonnOqDUv6PKFrFLy6lFCU5ASDd/SwRzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037