UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vsBl37XY3zWoV/wLiL0tv1WlyuXhTCkVlqXr2zIyIqE='
WHERE
key_id = 'd4551e75fde4826549182e201f3e56567a15ca2284aefa9ab3d2810fb034dfeb'
AND (
token = 'vsBl37XY3zWoV/wLiL0tv1WlyuXhTCkVlqXr2zIyIqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)