UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T6vPiNKZ1Cc2+rkCc9e2itC9x9mAN+i266H9jTwkxBw=' 
WHERE 
  key_id = 'f48ae3d625ae0dba8a1e7fd584133399c04e09a93fab53a7dcc8b7a53efe4259' 
  AND (
    token = 'T6vPiNKZ1Cc2+rkCc9e2itC9x9mAN+i266H9jTwkxBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030