UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xmtdTMUB4QLT676iNEGtzEriO+FEgP4Xs/Mt2k5JKtg='
WHERE
key_id = '52ef9b52844613366930eb6e516a40b29ad815a197ac93064461407ddf35dfdb'
AND (
token = 'xmtdTMUB4QLT676iNEGtzEriO+FEgP4Xs/Mt2k5JKtg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)