UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+t4xwFQ9GpctKIsCjlNRTLmk8hAkPfpaKw8eaYqBCC0='
WHERE
key_id = '480ed83e65b93569f88138387283cd868293ee9493f75496164473b9b94a9e11'
AND (
token = '+t4xwFQ9GpctKIsCjlNRTLmk8hAkPfpaKw8eaYqBCC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)