UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lw15asqx5XuIjXtXo30K4TSOm8HA/8r4T1qq55hWn+o=' 
WHERE 
  key_id = '64fe0ccd218d7adf88e265b8d415a8bdb6ae4b775271e290525f6b5cdaddae21' 
  AND (
    token = 'Lw15asqx5XuIjXtXo30K4TSOm8HA/8r4T1qq55hWn+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018