UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLmU7A8aIJcFerCl0fdXSZTBPJlNDbTscmd/m886K+c='
WHERE
key_id = '9074d9102c33c730c4a1e29d066bcb8cf5e725e98e2b52414aed85f0d87a3cec'
AND (
token = 'nLmU7A8aIJcFerCl0fdXSZTBPJlNDbTscmd/m886K+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)