UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G6C9mDTj65KFtC67IVCi11rXio4Aai/KFsxC0MlQbEU='
WHERE
key_id = '951145b655e793fee6838d3cf132b05242b217ea5dc048025a0c5cba08659562'
AND (
token = 'G6C9mDTj65KFtC67IVCi11rXio4Aai/KFsxC0MlQbEU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)