UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '72PjTEPsN8q+Jz+2kyhSR9SWjVBV5GgUWbzJCTujNfs='
WHERE
key_id = 'c1fb433ceec4d4b7efbacdc8f40dcb257fcb947fe8568345fbb4fa341f046c21'
AND (
token = '72PjTEPsN8q+Jz+2kyhSR9SWjVBV5GgUWbzJCTujNfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)