UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd+g0e1xFzGoTIaZFoFc/hnwc4yJoO/CJBhovPb+AUUE='
WHERE
key_id = '6a76b05b50a8268aa42d8e02988538f057ad82aa98c77e48b88da7e4a15f1b3a'
AND (
token = 'd+g0e1xFzGoTIaZFoFc/hnwc4yJoO/CJBhovPb+AUUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)