UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1+M31IzF2IGYZeTaVo7UkSc41U+aD2nkZoScDIsOJjU='
WHERE
key_id = 'd3565a502dfd52ac442f95cd5533d0c8a251fb10335b35464a4cf83c213eb87c'
AND (
token = '1+M31IzF2IGYZeTaVo7UkSc41U+aD2nkZoScDIsOJjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)