UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4HMAN6Ifd85Ihi1Ty1+27+djGE/IH1ztQI15zOtPwoc=' 
WHERE 
  key_id = '5e7fc5535e3a76560c10239edd4fc998947f03903c359de2c6f694c9e4c1c3c5' 
  AND (
    token = '4HMAN6Ifd85Ihi1Ty1+27+djGE/IH1ztQI15zOtPwoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031