UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YzFBgSKLkcFMfyvKO4q8Av0EW3U8YGlgQ73H22owEyA='
WHERE
key_id = 'd0b84d962e124f936cb71b4aadc5c07b6309253c9a9fe24a2acc8171d064fb03'
AND (
token = 'YzFBgSKLkcFMfyvKO4q8Av0EW3U8YGlgQ73H22owEyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)