UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V/zywJJ0gmykUrdRontbrq//YEQF8nUaUmjXZROJa98=' 
WHERE 
  key_id = 'a7250a340af3a59887793bee59225cdcda2607c72cae0cd493c37ac9723fca9a' 
  AND (
    token = 'V/zywJJ0gmykUrdRontbrq//YEQF8nUaUmjXZROJa98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027