UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wle+Z5buNzwL1v/ItKR2MzgFC/Mr6oRuFExh1D3QRWw=' 
WHERE 
  key_id = '69e22bd0ec702642bc5a6f231f08d170dcc3673532cfc8e5e83ea6347c98ff5d' 
  AND (
    token = 'wle+Z5buNzwL1v/ItKR2MzgFC/Mr6oRuFExh1D3QRWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025