UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CzilSLmMy7nkobLyxR28g8wdM2nSii/fjXAPSN432Ts=' 
WHERE 
  key_id = '1fcb8a3c54bfb0e052046b70ed8d9698ae3d8b208e626dc64bdb8ff79b1f47a0' 
  AND (
    token = 'CzilSLmMy7nkobLyxR28g8wdM2nSii/fjXAPSN432Ts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020