UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JIEQIP/JsbXvwKGV89J7pWdXQ7PVSGEfxg+MbzxGdBg='
WHERE
key_id = '758149883b123d204856036475e0ac1578b93e6f5a0fe49a9198a2bca24421a6'
AND (
token = 'JIEQIP/JsbXvwKGV89J7pWdXQ7PVSGEfxg+MbzxGdBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)