UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rz2m/YOYlrvJjy/QGaIEwAakhvHHSlgJqNrR1XQZEdA='
WHERE
key_id = '38d6adfbf75a504703cb558f884f375d509ff56447482864cb4c6a636d994ab0'
AND (
token = 'rz2m/YOYlrvJjy/QGaIEwAakhvHHSlgJqNrR1XQZEdA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)