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