UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vf6RET/yUpm2MedcxrdJoBvcHq+erjpIF+0GpthiIu8=' 
WHERE 
  key_id = 'fdbf2cb5229bfe7b034318fd51841c0cfb7392bc3d2f3dab65fdc8357ed10618' 
  AND (
    token = 'Vf6RET/yUpm2MedcxrdJoBvcHq+erjpIF+0GpthiIu8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027