UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SooxzqGvI7ZErZoXQr5nnPLCHE1Zg3pE2PmHWOO3nmw=' 
WHERE 
  key_id = '2d9ef7114baedf6aa93229c6f24d1160742635451fb6438f902cf0ad00737c15' 
  AND (
    token = 'SooxzqGvI7ZErZoXQr5nnPLCHE1Zg3pE2PmHWOO3nmw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053