UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dq1coQzablvYaRKOvCaZTIGgd52n71iqm7XBls69rdg='
WHERE
key_id = '01557c605afb273146abfb332bda35ad18d73858f25fd1ab331e5d19ba3be766'
AND (
token = 'dq1coQzablvYaRKOvCaZTIGgd52n71iqm7XBls69rdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)