UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l5Oj1Z+uxqafIKttJeEskKMo2wKpTXPvr7qMadk2n7k='
WHERE
key_id = '954b9ef4233e454b1514ed6bcf92a53e0dd8485def3774c85d1ae5f617d3debd'
AND (
token = 'l5Oj1Z+uxqafIKttJeEskKMo2wKpTXPvr7qMadk2n7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)