UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pHQ2lr9l3QnHRCOUiGlMk0f96EbK2lkh4uQbBNyZiwA=' 
WHERE 
  key_id = 'ec3f59b9ad6af4fbd141de40789b7c216ccc30e766f8ffbd99949aa469d14d32' 
  AND (
    token = 'pHQ2lr9l3QnHRCOUiGlMk0f96EbK2lkh4uQbBNyZiwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035