UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rn/4xNFWDXmlstCKelcGI6W0CxcknjUSL0Jqo6og7zE='
WHERE
key_id = '158577e6356c5955ff107d1ffe444bb134157686470a0ff6c3d478e7acadf069'
AND (
token = 'Rn/4xNFWDXmlstCKelcGI6W0CxcknjUSL0Jqo6og7zE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)