UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N+qTEqwq2Bk0Ty1HBgWXMKsHqCtRaQsr8c0BzC4kTiY='
WHERE
key_id = '4daa0bab15fe37ffab25063ee326f0d04d2ebff0526c3ab77c2ac7007272c219'
AND (
token = 'N+qTEqwq2Bk0Ty1HBgWXMKsHqCtRaQsr8c0BzC4kTiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)