UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J3tbMHuFtke2gu58DlUyMrXdPmKjLStDcd6BFlP4sBE='
WHERE
key_id = 'b3ac5befaa6eb666492bdef6dc1c8c4ea749c7838c25a5362eca592c23471249'
AND (
token = 'J3tbMHuFtke2gu58DlUyMrXdPmKjLStDcd6BFlP4sBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)