UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eN7x80aAGBpyJaFaXqkkrE6b1+HgwJRjopjXNe9CT3E='
WHERE
key_id = '5b1070e8321909c4054dcf07615d897f5598c4a6cf2e8c10e23f0b16307d52d8'
AND (
token = 'eN7x80aAGBpyJaFaXqkkrE6b1+HgwJRjopjXNe9CT3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)