UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oipWgOCPuxWHVGie2eukRltwpKEaberm9oFfy3+CdnI='
WHERE
key_id = '569fbab4f5feb012d07eb701f9385cc364ff654b2cc15bc0694b2d876488ca0a'
AND (
token = 'oipWgOCPuxWHVGie2eukRltwpKEaberm9oFfy3+CdnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)