UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '32Z7rIWuMRMAhj63GzwMeFvZrBCzRhiyrHzpyTO4qPw=' 
WHERE 
  key_id = 'c025a4b8a845a3433fbe715bf29e78f5e828a87baa28259bff82cfe6d9d66a86' 
  AND (
    token = '32Z7rIWuMRMAhj63GzwMeFvZrBCzRhiyrHzpyTO4qPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055