UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UWQiP4oIqD8fCY/5QZyPv84XOfGqDHDm3gFXSL2/HUU=' 
WHERE 
  key_id = '58cb72ecc6dbde599e90e2e43d392f0747a4fb9a00a7fc181d223c53a48ab6f1' 
  AND (
    token = 'UWQiP4oIqD8fCY/5QZyPv84XOfGqDHDm3gFXSL2/HUU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050