UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QlVH6y5YjdjlHD+tMwkgrTQ7TmbxsH90OCVvnkCwLQE='
WHERE
key_id = '16c824051fe1f295f493ce792bce1e79247aa24f5a2508ca8d2b1a551a0f4e32'
AND (
token = 'QlVH6y5YjdjlHD+tMwkgrTQ7TmbxsH90OCVvnkCwLQE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)