UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wVM7z51Ibk28e3+LCYPLXdvV4LC7Biqwtj2eCYlK5es='
WHERE
key_id = '25144d157a3c674c3a515a20f7a54702647eb549f9f796d1788a836f315fd18a'
AND (
token = 'wVM7z51Ibk28e3+LCYPLXdvV4LC7Biqwtj2eCYlK5es='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)