UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DAOTYMjU5vg6ymxmnVbJ6hxallRSKZELAZcA0zMZsTU=' 
WHERE 
  key_id = '6d63587dc00d544a351443306d7785e1323757ba6b2df03308447983e5e567e4' 
  AND (
    token = 'DAOTYMjU5vg6ymxmnVbJ6hxallRSKZELAZcA0zMZsTU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036