UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm0ineI/xcpwZa/N4BobDTQMRoDLT58oLSPQXaBca76E='
WHERE
key_id = 'd6ee2d8948556ed85718ca6b08c24eff849489af12de3fb40861af97ce80368a'
AND (
token = 'm0ineI/xcpwZa/N4BobDTQMRoDLT58oLSPQXaBca76E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)