UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fdvQnq41Vwt5RRMOl8XieQVIEsnYoIv9a874Fc/ObQU='
WHERE
key_id = '8c43a3d85ee05f3c64a3d16dd891ec7174a0ece13475b033361bad562d3809cc'
AND (
token = 'fdvQnq41Vwt5RRMOl8XieQVIEsnYoIv9a874Fc/ObQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)