UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AooS8uGolVSPZ6UQLbQtZp4rNTNt2R+jHr6aPlYuBtA='
WHERE
key_id = '9ab311cda936d3afc200e0bc0865ff35997a713e76026b4c0c4b53836edb8cd6'
AND (
token = 'AooS8uGolVSPZ6UQLbQtZp4rNTNt2R+jHr6aPlYuBtA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)