UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9WRKN2Tk0YbieALvev5iZdU3aPcnyvo3Qg3ELhwpyFY='
WHERE
key_id = '25e078b07c069abcd828a165f83a9ee99fe8c90d905f9a54e984c2156a5bce73'
AND (
token = '9WRKN2Tk0YbieALvev5iZdU3aPcnyvo3Qg3ELhwpyFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)