UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CchMptNBT4DzGyIzZvS5WZyEngje90Da/WL+aeyAmHg='
WHERE
key_id = '5205da93a2b0bc932d5e678d3d8724a6acf5e77bb7ac47eb8d4b6602c1f3f043'
AND (
token = 'CchMptNBT4DzGyIzZvS5WZyEngje90Da/WL+aeyAmHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)