UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PuQL8C1+GjCBDyigO+iLO5dxvbffFmoaSdu7QBbulgc='
WHERE
key_id = '473511bca538ba3c75a28f16c06ed9a7bc06103e48cd5b01c8d499a5dba94998'
AND (
token = 'PuQL8C1+GjCBDyigO+iLO5dxvbffFmoaSdu7QBbulgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)