UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6JQHVBjjIxMa/du+cN1SWiGgVW1ntJkUx2PI7XdNA7s=' 
WHERE 
  key_id = 'c678ff43c5c8d3d0c98b89ee0572fb039a24463b258722f01b4e0aae5853dd85' 
  AND (
    token = '6JQHVBjjIxMa/du+cN1SWiGgVW1ntJkUx2PI7XdNA7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031