UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5wms4qkgit/ds6eCJzbxsyYoAArORdJ8beijPvCy/oU='
WHERE
key_id = '01ba5f8ef63a015026e2805152cc3339af85096e736081aded8d74f6851d18be'
AND (
token = '5wms4qkgit/ds6eCJzbxsyYoAArORdJ8beijPvCy/oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)