UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aXbtZxiapBY9owwCBMMNHY/+CZ/ZegWotW32uTdPkxo=' 
WHERE 
  key_id = 'c8571affc006a4a8483552c0914b74ced8503adb12e7c90bfbe8ef4e3844d1e4' 
  AND (
    token = 'aXbtZxiapBY9owwCBMMNHY/+CZ/ZegWotW32uTdPkxo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061